package com.dd.ent.car.common.player;

/**
 * Author:LiuJianSheng
 * Date:2016/7/6
 */
public class VideoInfo {
    private String sourceUrl;
    private String title;
    private String movieId;
    private String gcid;
    private boolean playSilence;//播放时是否静音
    private boolean shouldInsertRecord = true;//是否需要添加播放记录
    private int startPosition;//播放开始时，seek到指定的位置开始播放
    private VideoPlayListener playListener;
    private String playFrom;//单次播放来源
    private String sAb;//算法ab标识
    private String sVersion;//服务器算法版本号
    private String params;//服务器算法扩展字段
    private String poster;//海报url

    public VideoInfo(String movieId, String sourceUrl, String title) {
        this(movieId, sourceUrl, title, null);
    }

    public VideoInfo(String movieId, String sourceUrl, String title, String playFrom) {
        this.movieId = movieId;
        this.sourceUrl = sourceUrl;
        this.title = title;
        this.playFrom = playFrom;
    }

    public String getSourceUrl() {
        return sourceUrl;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getMovieId() {
        return movieId;
    }

    public boolean isPlaySilence() {
        return playSilence;
    }

    public void setPlaySilence(boolean playSilence) {
        this.playSilence = playSilence;
    }

    public String getGcid() {
        return gcid;
    }

    public void setGcid(String gcid) {
        this.gcid = gcid;
    }

    public void setShouldInsertRecord(boolean shouldInsertRecord) {
        this.shouldInsertRecord = shouldInsertRecord;
    }

    public boolean isShouldInsertRecord() {
        return shouldInsertRecord;
    }

    public void setStartPosition(int startPosition) {
        this.startPosition = startPosition;
    }

    public int getStartPosition() {
        return startPosition;
    }

    public VideoPlayListener getPlayListener() {
        return playListener;
    }

    public void setPlayListener(VideoPlayListener playListener) {
        this.playListener = playListener;
    }

    public String getPlayFrom() {
        return playFrom;
    }

    public void setPlayFrom(String playFrom) {
        this.playFrom = playFrom;
    }

    public String getsAb() {
        return sAb;
    }

    public void setsAb(String sAb) {
        this.sAb = sAb;
    }

    public String getsVersion() {
        return sVersion;
    }

    public void setsVersion(String sVersion) {
        this.sVersion = sVersion;
    }

    public String getParams() {
        return params;
    }

    public void setParams(String params) {
        this.params = params;
    }

    public String getPoster() {
        return poster;
    }

    public void setPoster(String poster) {
        this.poster = poster;
    }

    @Override
    public String toString() {
        return "VideoInfo{" +
                "startPosition=" + startPosition +
                ", sourceUrl='" + sourceUrl + '\'' +
                ", title='" + title + '\'' +
                ", movieId='" + movieId + '\'' +
                ", gcid='" + gcid + '\'' +
                ", playSilence=" + playSilence +
                ", shouldInsertRecord=" + shouldInsertRecord +
                '}';
    }

    public interface VideoPlayListener {
        /**
         * 视频开始播放，只在首次播放回调
         *
         * @param videoInfo
         */
        void onVideoPlayStart(VideoInfo videoInfo);

        /**
         * 视频结束播放
         *
         * @param videoInfo
         */
        void onVideoPlayEnd(VideoInfo videoInfo);
    }
}
